﻿using System;
using VendorExpenses.Model;
using VendorExpenses.Context;
using VendorExpenses.Context.Migrations;
using System.Data.Entity;

namespace XMLReaderAndWriter
{
    public class XMLReaderAndWriter
    {
        public static void Main()
        {
            // Creates the XML sales report
            XMLReportCreator.CreateReport();

            // Load XML data into SQL Server and MongoDB
            string fileName = "../../Vendors-Expenses.xml";
            XMLVendorExpensesLoader.LoadExpensesFromXML(fileName);

            // Load XML data into SQL Server
            //string fileName = "../../Vendors-Expenses.xml";
            //XMLVendorExpensesLoader.LoadExpensesIntoSQLServer(fileName);

            #region XmlIntoMongo
            // Load XML data into Mongo
            //string fileName = "../../Vendors-Expenses.xml";
            //XMLVendorExpensesLoader.LoadExpensesIntoMongoDB(fileName);

            // Creating db for vendor expenses
            //Database.SetInitializer(new MigrateDatabaseToLatestVersion<VendorExpensesContext, Configuration>());
            //VendorExpensesContext db = new VendorExpensesContext();

            //var vendor = new Vendor
            //{
            //    VendorName = "Zagorka Corp."
            //};

            //db.Vendors.Add(vendor);
            //db.SaveChanges();
            #endregion
        }
    }
}
